<html>
	<head>
		<meta  charset="utf-8"/>
		<title>异常处理</title>
		<script type="text/javascript">
			function myFun(x,y)
			{
				var z;
				try{
					if(y==0)
					{
				throw new Error("除数不能为0");
					}
					z=x/y;
				}
				catch(e)
				{
					z=e.message;
				}
				return z;
			}
			console.log(myFun(1,0));
		</script>
	</head>
	<body>
	</body>
</html>
